﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FormatSourceCode
{
    
    public partial class Form2 : Form
    {
        
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
            Form1.form1.Show();
        }

        

        private void Form2_Load(object sender, EventArgs e)
        {
            //获取存储单词出现频率的对象的list
            List<Words> list = Form1.form1.countAppearTimes();

            //将List中的数据添加到dataGridView中         
            foreach (Words wd in list)
            {

                int index = dataGridView1.Rows.Add();
                dataGridView1.Rows[index].Cells[0].Value = wd.getWord();
                dataGridView1.Rows[index].Cells[1].Value = wd.getTimes();
            }
        }
    }
}
